
function TagkeyCode({ text, keywords }) {
    keywords = [...new Set([...keywords])]
    keywords.forEach((item, index) => {
        let texIndex = text.indexOf(item)
        if (texIndex >= 0) {
            text = `${text.slice(0, texIndex)}<span style="color:rgb(22, 93, 255);background-color:rgb(232,243,255);padding: 2px 6px;">${item}</span>${text.slice(texIndex + item.length)}`
        }
    })
    return (
        <div dangerouslySetInnerHTML={{ __html: text }} />
    )
}

export default TagkeyCode;